<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		computed: {
		    i18n() {
		        return this.$t('message');
		    }
		},
    onShow: function() {
        console.log('App Show');
		
        let _this = this;
        // 取值存储的语言
        let lang = uni.getStorageSync('select');
		_this.$store.commit("set/SET_LANGUAGE", uni.getStorageSync('select') || 0)
        // 判断选择的语言
        if (lang) {
            _this.$i18n.locale = lang;
        } else {
            _this.$i18n.locale = 'zh-CN';
        }
		uni.setTabBarItem({
		    index: 0,
		    text: _this.i18n.tabBar.home,
		});
		uni.setTabBarItem({
		    index: 1,
		    text: _this.i18n.tabBar.period
		});
		uni.setTabBarItem({
		    index: 2,
		    text: _this.i18n.tabBar.point
		});
		uni.setTabBarItem({
		    index: 3,
		    text: _this.i18n.tabBar.balances
		});
    },
		onHide: function() {
			console.log('App Hide')
		},
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "uview-ui/index.scss";
</style>
